package com.example.yygh.order.controller.api;

import com.example.result.Result;
import com.example.yygh.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author hx
 * @create 2022/5/25 15:44
 * description:
 */
@RestController
@RequestMapping("/api/order/orderInfo")
public class OrderApiController {
    @Autowired
    private OrderService orderService;

    /**
     * 生成挂号订单
     * @param patientId
     * @param scheduleId
     * @return
     */
    @PostMapping("auth/submitOrder/{scheduleId}/{patientId}")
    public Result submitOrder(@PathVariable Long patientId, @PathVariable String scheduleId){
        Long orderId=orderService.saveOrder(scheduleId,patientId);
        return Result.ok(orderId);

    }

}
